this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,i,n,t,a,s){"use strict";function r(e,i){o(e,i);i.add(e)}function l(e,i,n){o(e,i);i.set(e,n)}function o(e,i){if(i.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function d(e,i,n){if(!i.has(e)){throw new TypeError("attempted to get private field on non-instance")}return n}var h=new WeakMap;var c=new WeakSet;var b=function(e){babelHelpers.inherits(n,e);function n(){var e;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,n);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(n).call(this,t));r(babelHelpers.assertThisInitialized(e),c);l(babelHelpers.assertThisInitialized(e),h,{writable:true,value:void 0});e.setEventNamespace("BX.Landing.UI.Form.StyleForm");e.subscribeFromOptions(s.fetchEventsFromOptions(t));i.Dom.addClass(e.layout,"landing-ui-form-style");e.iframe="iframe"in t?t.iframe:null;e.node="node"in t?t.node:null;e.selector="selector"in t?t.selector:null;babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(e),h,new Map);e.onHeaderEnter=e.onHeaderEnter.bind(babelHelpers.assertThisInitialized(e));e.onHeaderLeave=e.onHeaderLeave.bind(babelHelpers.assertThisInitialized(e));e.onHeaderClick=e.onHeaderClick.bind(babelHelpers.assertThisInitialized(e));i.Event.bind(e.header,"click",e.onHeaderClick);i.Event.bind(e.header,"mouseenter",e.onHeaderEnter);i.Event.bind(e.header,"mouseleave",e.onHeaderLeave);if(e.type==="attrs"){i.Dom.addClass(e.header,"landing-ui-static")}if(e.iframe){e.onFrameLoad()}return e}babelHelpers.createClass(n,[{key:"onFrameLoad",value:function e(){if(!this.node){this.node=babelHelpers.toConsumableArray(this.iframe.document.querySelectorAll(this.selector))}}},{key:"onHeaderEnter",value:function e(){t.Highlight.getInstance().show(this.node)}},{key:"onHeaderLeave",value:function e(){t.Highlight.getInstance().hide()}},{key:"onHeaderClick",value:function e(i){i.preventDefault()}},{key:"addField",value:function e(i){if(i){var n;var t=i===null||i===void 0?void 0:(n=i.data)===null||n===void 0?void 0:n.attrKey;i.subscribe("onChange",this.onChange.bind(this));i.subscribe("onInit",this.onInit.bind(this));this.fields.add(i);this.body.appendChild(i.layout);if(t){babelHelpers.classPrivateFieldGet(this,h).set(t,i.getLayout())}}}},{key:"onChange",value:function e(i){d(this,c,u).call(this,i.getData());this.emit("onChange")}},{key:"onInit",value:function e(i){d(this,c,u).call(this,i.getData());this.emit("onInit")}}]);return n}(n.BaseForm);function u(e){var n=this;if(e.hide&&i.Type.isArray(e.hide)){e.hide.map((function(e){var i=babelHelpers.classPrivateFieldGet(n,h).get(e);if(i){i.style.display="none"}}))}if(e.show&&i.Type.isArray(e.show)){e.show.map((function(e){var i=babelHelpers.classPrivateFieldGet(n,h).get(e);if(i){i.style.display="block"}}))}}e.StyleForm=b})(this.BX.Landing.UI.Form=this.BX.Landing.UI.Form||{},BX,BX.Landing.UI.Form,BX.Landing.UI,BX.Landing.UI.Field,BX.Landing.UI.Component);
//# sourceMappingURL=styleform.bundle.map.js